package com.junchenrobot.mes.config;

import com.github.lianjiatech.retrofit.spring.boot.config.RetrofitProperties;
import com.github.lianjiatech.retrofit.spring.boot.log.AggregateLoggingInterceptor;
import com.github.lianjiatech.retrofit.spring.boot.log.LoggingInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 日志配置
 *
 * @author SeaWave
 * @date 2022/10/31
 */
@Configuration
public class LoggerConfig {
    
    // @Bean
    // public LoggerInterrupt loggerInterrupt(RetrofitProperties retrofitProperties) {
    //     return new LoggerInterrupt(retrofitProperties.getGlobalLog());
    // }
    //
    @Bean
    public LoggingInterceptor loggingInterceptor(RetrofitProperties retrofitProperties) {
        return new AggregateLoggingInterceptor(retrofitProperties.getGlobalLog());
    }
    
}
